
public class Task1 {

	
	public static void main(String[] args) {
		int n =4;
		int m = 4;
		int counter = 1;
		int[][] arr = new int[n][m];
		
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				arr[j][i]=counter;
				counter++;	
			}
			
		}
		for (int i = 0; i < arr.length; i++) {
			System.out.println();
			for (int j = 0; j < arr[0].length; j++) {
				System.out.print(arr[i][j]+" ");
			}
			
		}
		
		

	}

}
